feat(esm): packages/internal: Update test fixtures to use ESM style gql imports#380
feat(esm): packages/internal: Update test fixtures to use ESM style gql imports#380
Conversation
✅ Deploy Preview for cedarjs canceled.
|
There was a problem hiding this comment.
Greptile Summary
This PR updates GraphQL tag imports in test fixture files from CommonJS-style default imports (import gql from 'graphql-tag') to ESM-style named imports (import { gql } from 'graphql-tag'). The changes affect four test fixture files in the packages/internal package that are used for GraphQL code generation testing.
The modification is part of Cedar's broader migration to ESM (ECMAScript Modules) support. The graphql-tag package requires named imports when running in ESM environments due to how modern module resolution works with TypeScript and bundlers. While these changes don't affect the actual test behavior (as noted in the PR description), they ensure that the test fixtures match the import patterns that will be used in newly generated Cedar applications.
The affected files are all located in packages/internal/src/__tests__/fixtures/graphqlCodeGen/ and specifically target the requireAuth and skipAuth directive files in both the bookshelf and realtime test fixture directories. These fixtures are used by the internal package's testing infrastructure to validate GraphQL code generation functionality.
This change prepares the codebase for the upcoming ESM transition by ensuring consistency between test fixtures and the actual code patterns that will be generated for users, maintaining alignment with the framework's modernization efforts.
Confidence score: 5/5
- This PR is extremely safe to merge with no risk of breaking functionality
- Score reflects simple import syntax changes with no logic modifications and clear ESM migration purpose
- No files require special attention as all changes are identical import statement updates
4 files reviewed, no comments
Pulling these changes over from #80. It seems it doesn't really matter for the tests that use these fixtures how
gqlis imported, but now at least they match what it will soon look like in all new Cedar apps